package threadexercise;

public class ThreadDemo1 {
    public static void main(String[] args) {
        MyThread1 thread1=new MyThread1();
        MyThread2 thread2=new MyThread2();
        thread1.start();
        thread2.start();

    }
}

class MyThread1 extends Thread{//继承Thread类
    public void run(){//重写run()
        for (int i=1;i<10000;i++){
            System.out.println("你是谁？");
        }
    }
}

class MyThread2 extends Thread{
    public void run(){
        for (int i=0;i<10000;i++){
            System.out.println("查水表的");
        }
    }
}

